package org.blogwu.learn.designpattern.chapter4.v3;

/**
 * 简单工厂方法
 * 缺点是,随着业务复杂,此类会不断进行修改
 */
public class VideoFactory {

    public static Video getVideoByType(Class clazz) {
        Video video = null;
        try {
            video = (Video) clazz.newInstance();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return video;
    }

}
